﻿@model IEnumerable<MvcBlog.Models.Post>

@{
    ViewBag.Title = "Search";
    Layout = "~/Views/Shared/_LayoutDashboard.cshtml";
}

<h2>Search</h2>

<p>
    @Html.ActionLink("Create New", "Create")
</p>

@using (Html.BeginForm())
{
    <p>Search for: @Html.TextBox("SearchString") <input type="submit" value = "Find" /> </p>
}

<table>
    <tr>
        <th>
            Title
        </th>
        <th>
            Content
        </th>
        <th>
            PostDate
        </th>
        <th>
            CategoryID
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.Title)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Content)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.PostDate)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.CategoryID)
        </td>
        <td>
            @Html.ActionLink("Edit", "Edit", new { id=item.PostID }) |
            @Html.ActionLink("Details", "Details", new { id=item.PostID }) |
            @Html.ActionLink("Delete", "Delete", new { id=item.PostID })
        </td>
    </tr>
}

</table>
